package com.javachmapi.controller;

import com.javachmapi.dao.IAccountDao;
import com.javachmapi.service.IAccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;

/**
 * 控制层
 */
@Controller
public class MyController {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext ac= new ClassPathXmlApplicationContext("bean.xml");
        IAccountService as1 = (IAccountService) ac.getBean("accountService");
        IAccountService as2 = (IAccountService) ac.getBean("accountService");
        System.out.println("==========判断是否是单例==========");
        System.out.println(as1==as2);
        ac.close();
    }
}
